Skip to content

Conversation

@kvinwang
Copy link
Collaborator

Summary

  • Fix dummy.rs get_quote signature to match linux.rs
  • Remove unused cc_eventlog::TdxEventLog import

Problem

When building for x86_64-unknown-linux-musl target, the code fails to compile because:

  1. dummy.rs is selected (since target_env != "gnu")
  2. The get_quote function signature in dummy.rs doesn't match linux.rs
  3. dstack-attest calls tdx_attest::get_quote(report_data) with 1 argument, but dummy.rs expects 2

Error:

error[E0061]: this function takes 2 arguments but 1 argument was supplied
   --> vendor/dstack/dstack-attest/src/attestation.rs:608:29
    |
608 |                 let quote = tdx_attest::get_quote(report_data).context("Failed to get quote")?;

Solution

Align dummy.rs API signatures with linux.rs:

  • get_quote(report_data: &TdxReportData) -> Result<Vec<u8>>

Use Case

This enables building static binaries with musl for better cross-distro compatibility. For example, binaries built on Ubuntu with glibc 2.39 don't work on RockyLinux 9 which has glibc 2.34. Static musl builds solve this.

The dummy.rs module is used when building for non-GNU targets like
x86_64-unknown-linux-musl. However, the function signatures didn't
match linux.rs, causing compilation failures:

1. `get_quote` signature mismatch:
   - linux.rs: `get_quote(report_data: &TdxReportData) -> Result<Vec<u8>>`
   - dummy.rs: `get_quote(_report_data: &TdxReportData, _att_key_id_list: Option<&[TdxUuid]>) -> Result<(TdxUuid, Vec<u8>)>`

2. Unused import `cc_eventlog::TdxEventLog` (TdxEventLog doesn't exist
   in cc_eventlog, only TdxEvent does)

This fix aligns dummy.rs with linux.rs to enable musl static builds,
which are useful for cross-distro binary compatibility.
@kvinwang kvinwang merged commit 4c6cf88 into master Jan 27, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants